package com.xinke.module.system.mapper.tenant;

import java.util.*;

import com.xinke.component.common.pojo.PageResult;
import com.xinke.component.mybatis.mybatis.core.query.LambdaQueryWrapperExt;
import com.xinke.component.mybatis.mybatis.core.mapper.BaseMapperExt;
import com.xinke.module.system.model.entity.tenant.TenantPackageDO;
import org.apache.ibatis.annotations.Mapper;
import com.xinke.module.system.model.vo.tenant.*;

/**
 * 租户套餐 Mapper
 *
 * @author yzx
 */
@Mapper
public interface TenantPackageMapper extends BaseMapperExt<TenantPackageDO> {

    default PageResult<TenantPackageDO> selectPage(TenantPackagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperExt<TenantPackageDO>()
                .likeIfPresent(TenantPackageDO::getPackageName, reqVO.getPackageName())
                .eqIfPresent(TenantPackageDO::getPackageStatus, reqVO.getPackageStatus())
                .eqIfPresent(TenantPackageDO::getRemark, reqVO.getRemark())
                .eqIfPresent(TenantPackageDO::getMenuIds, reqVO.getMenuIds())
                .orderByDesc(TenantPackageDO::getPackageId));
    }

}